package com.cndll.upclass.ui.frag

import android.os.Bundle
import android.view.ViewGroup
import app.cn.com.school.R
import app.cn.com.school.fragment.BaseVlayoutFragment
import app.cn.com.school.fragment.BaseVlayoutFragment.Companion.MODE_PULL
import app.cn.com.school.tools.VLayoutHelper
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
import com.umeng.socialize.utils.DeviceConfig.context

/**
 * Created by 张志鹏 on 2017-11-15  14:33
 */

class BlankFragment : BaseVlayoutFragment() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    }

    override fun pullData(mode: Int): Boolean {
        return true
    }

    override fun init() {
        super.init()

        pullData(MODE_PULL)
    }

    override fun setVLayout() {
        super.setVLayout()
        adapterList.add(object : VLayoutHelper.Builder() {}.
                setContext(context).
                setCount(20).
                setLayoutHelper(LinearLayoutHelper()).
                setViewType(8).
                setRes(R.layout.item_message).
                setParams(ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                        windowManager.defaultDisplay.height / 5)).
                setOnBindView({ itemView, position ->

                }).creatAdapter())
        adapter.addAdapters(adapterList)
    }

    companion object {
        open val FLAG = "消息内容"
        fun newInstance(): BlankFragment {
            val fragment = BlankFragment()
            val args = Bundle()
            fragment.arguments = args
            return fragment
        }
    }
}
